<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/WEB-INF/tlds/messageTag.tld" prefix="msg"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title><msg:message key="menu.config" /></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
	<link rel="StyleSheet" href="${pageContext.request.contextPath}/css/table4jtheme/tabletree4j.css" type="text/css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/js/layer/skin/espresso/style.css"></link>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/js/layer/skin/layer.css" id="layui_layer_skinlayercss"/>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/jquery.ui.css"></link>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/base.css"></link>
	
	<%-- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/ztree/demo.css" type="text/css"> --%>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/jquery-3.1.1.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/tether.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ui.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/js/layer/ajaxloading.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/layer/layer.js"></script>
	
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/ztree/jquery.ztree.core.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/ztree/jquery.ztree.excheck.js"></script>

	<style>
	
		.bigtitle{
			font-family:Arial;
			font-weight:bold;
			font-size:22px;
			margin-bottom:10px;
		}
		.footer{
			font-family:Arial;
			font-weight:bold;
			font-size:12px;
			color:#747474;
		}
	
		.title{
			padding-left:10px;
			font-family:Arial;
			/*font-weight:bold;*/
			font-size:18px;
			color:#747474;
		}
	
		.fromtitle{
			background-color:#f5f5f5;
			text-align:center;
			font-family:Arial;
			color:#acac59;
			padding-top:5px;
			padding-bottom:5px;
		}
	
		.fromcontent{
			font-family:Arial;
			padding-right:5px;
			padding-bottom:10px;
			padding-top:10px;
		}
	
		.content{
			font-family:Arial;
		}
		.clickbtn{
			cursor:pointer;
		}
		.headerbg{
			background:#328aa4 url(img/tr_back.gif) repeat-x;color:#fff;
			height:27px;
			font-family:"Arial";
		}
		.headerbg td{
			text-align:center;
		}
	
	
		.tabletree4j-gird td{
		height:27px;
		}
	
		.arrow-tt-node-content{
			text-align:center;
			width:100%;
		}
		.circle-tt-node-content{
			text-align:center;
			width:100%;
		}
		.default-tt-node-content{
			text-align:center;
			width:100%;
		}
	</style>
	
	<style type="text/css">
		.jinduBg{
            width: 120px;
            height: 30px;
            margin-right: 50px;
            border: 1px solid grey;
            border-radius: 5px;
            cursor: pointer;
            float:right;
        }
        .jindu{
            width: 50%;
            height: 28px;
            background: #1FA8F1;
            border-radius: 4px;
        }
	</style>
	<style type="text/css">
    .textarea {width: 80%; height:80px; padding: 10px; boder:1px solid #ddd; border-radius: 10px; box-shadow: inset 5px 5px 5px #eee;resize:none;}
    .tags {padding: 15px;}
    .tags .tag-link {cursor: pointer; display: inline-block; padding: 5px 10px; margin-right: 10px; border:1px solid #fff;}
    .tags .tag-link:hover {color: #f60;}
    .view {position: relative; padding-left: 80px;}
    .view .view-title {position: absolute; width: 75px; top: 0; left: 0; text-align: right;}

    .moretip-text {white-space: normal; word-break: break-all; word-wrap: break-word; width: 310px; margin-right: 0;}
	</style>
	
	<script language="javascript">
	function defaultConfig() {
		$("#controlModelOn").val();
		$("#controlModelDown").val();
		$("#turnonVol").val(5);
		$("#turnonTime").val("17:00");
		$("#shutdownTime").val("07:00");
		$("#workModel").val("00");
		$("#topVol").val("12");
		$("#lowVol").val("10");
		$("#exitVol").val("11");
		$("#lowStartVol").val("11");
		$("#lowEndVol").val("10");
		$("#maxWorkCurrent").val("300");
		$("#time1").val("600");
		$("#workCurrent1").val("100");
		$("#workCurrent1JD").width("100%");
		$("#workCurrent1Val").text("100");
		$("#time2").val("0");
		$("#workCurrent2").val("0");
		$("#workCurrent2JD").width("0%");
		$("#workCurrent2Val").text("0");
		$("#time3").val("0");
		$("#workCurrent3").val("0");
		$("#workCurrent3JD").width("0%");
		$("#workCurrent3Val").text("0");
		$("#time4").val("0");
		$("#workCurrent4").val("0");
		$("#workCurrent4JD").width("0%");
		$("#workCurrent4Val").text("0");
	}
	
	function submitAdd() {
		var templateName = $("#templateName").val();
		if(templateName=="") {
			alert("<msg:message key='config.add.msg.input.templatename' />");
			return;
		}
		
		var controlModelOn = $("#controlModelOn").val();
		var controlModelDown = $("#controlModelDown").val();
		var turnonVol = $("#turnonVol").val();
		var turnonTime =  $("#turnonTime").val();
		var shutdownTime = $("#shutdownTime").val();
		var workModel = $("#workModel").val();
		var topVol = $("#topVol").val();
		if(topVol=="") {
			alert("<msg:message key='config.add.msg.input.topvol' />");
			return;
		}
		var lowVol =  $("#lowVol").val();
		if(lowVol=="") {
			alert("<msg:message key='config.add.msg.input.lowvol' />");
			return;
		}
		var exitVol = $("#exitVol").val();
		if(exitVol=="") {
			alert("<msg:message key='config.add.msg.input.exitvol' />");
			return;
		}
		var lowStartVol = $("#lowStartVol").val();
		if(lowStartVol=="") {
			alert("<msg:message key='config.add.msg.input.lowstartvol' />");
			return;
		}
		
		var lowEndVol = $("#lowEndVol").val();
		if(lowEndVol=="") {
			alert("<msg:message key='config.add.msg.input.lowendvol' />");
			return;
		}
		
		var maxWorkCurrent = $("#maxWorkCurrent").val();
		if(maxWorkCurrent=="") {
			alert("<msg:message key='config.add.msg.input.maxworkcurrent' />");
			return;
		}
		
		var time1 = $("#time1").val();
		if(time1=="") {
			alert("<msg:message key='config.add.msg.input.time1' />");
			return;
		}
		var workCurrent1 = $("#workCurrent1").val();
		if(workCurrent1=="") {
			alert("请输入1段电流");
			return;
		}
		var time2 = $("#time2").val();
		if(time2=="") {
			alert("<msg:message key='config.add.msg.input.time2' />");
			return;
		}
		var workCurrent2 = $("#workCurrent2").val();
		if(workCurrent2=="") {
			alert("请输入2段电流");
			return;
		}
		var time3 = $("#time3").val();
		if(time3=="") {
			alert("<msg:message key='config.add.msg.input.time3' />");
			return;
		}
		var workCurrent3 = $("#workCurrent3").val();
		if(workCurrent3=="") {
			alert("请输入3段电流");
			return;
		}
		var time4 = $("#time4").val();
		if(time4=="") {
			alert("<msg:message key='config.add.msg.input.time4' />");
			return;
		}
		var workCurrent4 = $("#workCurrent4").val();
		if(workCurrent4=="") {
			alert("请输入4段电流");
			return;
		}
		
		$.ajax({
			type : "POST",
			url : "${pageContext.request.contextPath }/addConfigTemplate.do",
			async: false,
			dataType : "json",
			data : {
				templateName : templateName,
				controlModelOn : controlModelOn,
				controlModelDown : controlModelDown,
				turnonVol : turnonVol,
				turnonTime : turnonTime,
				shutdownTime : shutdownTime,
				workModel : workModel,
				topVol : topVol,
				lowVol : lowVol,
				exitVol : exitVol,
				lowStartVol : lowStartVol,
				lowEndVol : lowEndVol,
				maxWorkCurrent : maxWorkCurrent,
				time1 : time1,
				workCurrent1 : workCurrent1,
				time2 : time2,
				workCurrent2 : workCurrent2,
				time3 : time3,
				workCurrent3 : workCurrent3,
				time4 : time4,
				workCurrent4 : workCurrent4,
			},
			success : function(data) {
				if(data.success==0) {
					addUserRes = true;
					alert(data.msg);
					layer.closeAll();
					location.href="${pageContext.request.contextPath}/showConfig.do";
				}else {
					alert(data.msg);
					addUserRes = false;
				}
			}
		});
	}
	
	function modelChange() {
		var controlModelOn = $("#controlModelOn").val();
		var controlModelDown = $("#controlModelDown").val();
		
		if(controlModelOn=="2" && controlModelDown=="2") {
			$("#onVolDiv").css("display","none");
		}else {
			$("#onVolDiv").css("display","block");
		}
		
		if(controlModelOn=="1") {
			$("#timeonDiv").css("display","none");
		}else {
			$("#timeonDiv").css("display","block");
		}
		if(controlModelDown=="1") {
			$("#timedownDiv").css("display","none");
		}else {
			$("#timedownDiv").css("display","block");
		}
		
		if(controlModelOn=="2" && controlModelDown=="1") {
			$("#onVolDivDoc").text("<msg:message key='config.turnoffpv' />：");
			$("#onVolDiv").css("margin-right","79px");
			$("#timeonDiv").css("margin-right","0px");
		}else {
			$("#onVolDivDoc").text("<msg:message key='config.turnonpv' />：");
			$("#onVolDiv").css("margin-right","0px");
			$("#timeonDiv").css("margin-right","23px");
		}
		
	}
	
	$(document).ready(function(){
		$(document).on('click','#add_config_btn',function(){
			
			// 详情 删除disabled
			$('#addTemplateForm :input').removeAttr('disabled');
			// 先清空表单
			$('#addTemplateForm [name="resetBtn"]').trigger('click');
			
            layer.open({

                type: 1,
                area:['770px','580px'],
                move: false,
                title: '<msg:message key="config.new" />',           
                content: $('#addTemplateLayer'), 		
                cancel: function(index){
                    layer.close(index);
                },
                btn:['<msg:message key="btn.confirm" />','<msg:message key="btn.cancel" />','<msg:message key="config.btn.defaultconfig" />'],
                yes:function(){ submitAdd();},
                cancel:function(){  console.log(222);layer.closeAll(); },
                btn3:function(){defaultConfig();return false;}
            });
			//location.href="${pageContext.request.contextPath}/gotoAddConfitTemplate.do";
		});
		
		var setting = {
				check: {
					enable: true
				},
				data: {
					simpleData: {
						enable: true
					}
				}
		};

		var zNodes = eval(${jsonTree});
		
		function configLights() {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");  
			var nodes=zTree.getCheckedNodes(true);  
			var result='';  
			if(nodes.length==0){  
				alert("请选择路灯！");  
				return false;  
			}  
			
			var templateIdd = $("#templateIdd").val();
			for (var i = 0; i < nodes.length; i++) {  
				var halfCheck = nodes[i].getCheckStatus();  
				if (!halfCheck.half && !nodes[i].isParent){  
					result += nodes[i].id +',';  
				}  
			}  
			result=result.substring(0,result.lastIndexOf(","));
			
			$.ajax({
				type : "POST",
				url : "${pageContext.request.contextPath}/configLights.do",
				async: false,
				dataType : "json",
				data : {
					templateId : templateIdd,
					lightIds : result
				},
				success : function(data) {
					alert(data.msg);
					/* if(data.success==0) {
						location.href = "${pageContext.request.contextPath}/showConfig.do";
					} */
				}
			});
		}
			
		function gotoConfig() {
			// 添加角色
			$('#lightsForm [name="resetBtn"]').trigger('click');
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			
			$("#templateIdd").val($("#templateId").val());
			
			layer.open({
				type: 1,
				title: '<msg:message key="config.btn.selectdevice" />',
				area:['700px','450px'],
				content: $('#memberLayer'),
				btn:['<msg:message key="btn.confirm" />','<msg:message key="btn.cancel" />'],
				yes:function(index){
					var res = configLights();
					if(res==true) {
						layer.close(index);
					}
				}
			});
		}
		
		// 详情
		$(document).on('click','[name="showLiBtn"]',function(){
			var templateId = $(this).attr('data-id');
			// 根id发送ajax获取数据
			
			// 先清空表单，重新赋值
			$('#addTemplateForm [name="resetBtn"]').trigger('click');
			// 详情 设置为disabled
			$('#addTemplateForm :input').attr('disabled', true);
			
			var queryTemplateInfo = false;
			$.ajax({
				type : "POST",
				url : "${pageContext.request.contextPath }/templateDetail.do",
				async: false,
				dataType : "json",
				data : {
					templateId : templateId
				},
				success : function(data) {
					if(data.success==0) {
						queryTemplateInfo = true;
						
						$("#templateId").val(data.templateBean.templateId);
						$("#templateName").val(data.templateBean.templateName);
						$("#controlModelOn").val(data.templateBean.controlModelOn);
						$("#controlModelDown").val(data.templateBean.controlModelDown);
						$("#turnonVol").val(data.templateBean.turnonVol);
						$("#turnonTime").val(data.templateBean.turnonTime);
						$("#shutdownTime").val(data.templateBean.shutdownTime);
						$("#workModel").val(data.templateBean.workModel);
						modelChange();
						$("#topVol").val(data.templateBean.topVol);
						$("#lowVol").val(data.templateBean.lowVol);
						$("#exitVol").val(data.templateBean.exitVol);
						$("#lowStartVol").val(data.templateBean.lowStartVol);
						$("#lowEndVol").val(data.templateBean.lowEndVol);
						$("#maxWorkCurrent").val(data.templateBean.maxWorkCurrent);
						$("#time1").val(data.templateBean.time1);
						$("#workCurrent1").val(data.templateBean.workCurrent1);
						$("#workCurrent1JD").width(data.templateBean.workCurrent1+'%');
						$("#workCurrent1Val").text(data.templateBean.workCurrent1);
						$("#time2").val(data.templateBean.time2);
						$("#workCurrent2").val(data.templateBean.workCurrent2);
						$("#workCurrent2JD").width(data.templateBean.workCurrent2+'%');
						$("#workCurrent2Val").text(data.templateBean.workCurrent2);
						$("#time3").val(data.templateBean.time3);
						$("#workCurrent3").val(data.templateBean.workCurrent3);
						$("#workCurrent3JD").width(data.templateBean.workCurrent3+'%');
						$("#workCurrent3Val").text(data.templateBean.workCurrent3);
						$("#time4").val(data.templateBean.time4);
						$("#workCurrent4").val(data.templateBean.workCurrent4);
						$("#workCurrent4JD").width(data.templateBean.workCurrent4+'%');
						$("#workCurrent4Val").text(data.templateBean.workCurrent4);
					}else {
						alert(data.msg);
						queryTemplateInfo = false;
					}
				}
			});
			
			if(queryTemplateInfo==false) {
				return;
			}
			
            layer.open({

                type: 1,
                area:['770px','580px'],
                move: false,
                title: '<msg:message key="config.details" />',           
                content: $('#addTemplateLayer'),
                btn:['<msg:message key="config.btn.selectdevice" />'],
                yes:function(index){ gotoConfig();layer.close(index);}
            });

		});
		
		// 删除
		$(document).on('click','[name="deleteLiBtn"]',function(){
			var id = $(this).attr('data-id');
			// 根id发送ajax获取数据
			if(confirm("<msg:message key='btn.confirmdelete' />")) {
				$.ajax({
					type : "POST",
					url : "${pageContext.request.contextPath }/deleteConfigTemplate.do",
					async: false,
					dataType : "json",
					data : {
						templateId : id
					},
					success : function(data) {
						if(data.success==0) {
							alert(data.msg);
							location.href = "${pageContext.request.contextPath}/showConfig.do";
						}else {
							alert(data.msg);
						}
					}
				});
			}
		});
     	
	});
	
	$(function(){
        $("#workCurrent1JDBG").click(function(e){
            var x=e.pageX;
            var y=$(this).offset().left;
            var z=$(this).width();
            var m=parseInt((((x-y)/z).toFixed(2))*100);
            $("#workCurrent1JD").width(m+'%');
            $("#workCurrent1").val(m);
            $("#workCurrent1Val").text(m);
        });
        
        $("#workCurrent2JDBG").click(function(e){
            var x=e.pageX;
            var y=$(this).offset().left;
            var z=$(this).width();
            var m=parseInt((((x-y)/z).toFixed(2))*100);
            $("#workCurrent2JD").width(m+'%');
            $("#workCurrent2").val(m);
            $("#workCurrent2Val").text(m);
        });
        
        $("#workCurrent3JDBG").click(function(e){
            var x=e.pageX;
            var y=$(this).offset().left;
            var z=$(this).width();
            var m=parseInt((((x-y)/z).toFixed(2))*100);
            $("#workCurrent3JD").width(m+'%');
            $("#workCurrent3").val(m);
            $("#workCurrent3Val").text(m);
        });
        
        $("#workCurrent4JDBG").click(function(e){
            var x=e.pageX;
            var y=$(this).offset().left;
            var z=$(this).width();
            var m=parseInt((((x-y)/z).toFixed(2))*100);
            $("#workCurrent4JD").width(m+'%');
            $("#workCurrent4").val(m);
            $("#workCurrent4Val").text(m);
        });
    });
	////////////////////////////////////////////////////////////////
	</script>
  </head>
  
  <body>
  <div class="header">
		<div class="left header-logo"><img class="header-logo-img" src="images/header_logo.png" /></div>
		<div class="right header-nav">
			<a class="nav-link" href="${pageContext.request.contextPath }/main.do">
				<i class="icon icon-home"></i>
				<span class="link-text"><msg:message key="menu.homepage" /></span>
			</a>
			<c:if test="${menubean.menu1 }">
			<a class="nav-link" href="${pageContext.request.contextPath }/showDevice.do">
				<i class="icon icon-install"></i>
				<span class="link-text"><msg:message key="menu.install" /></span>
			</a>
			</c:if>
			<c:if test="${menubean.menu2 }">
			<a class="nav-link active" href="${pageContext.request.contextPath}/showConfig.do">
				<i class="icon icon-config"></i>
				<span class="link-text"><msg:message key="menu.config" /></span>
			</a>
			</c:if>
			<c:if test="${menubean.menu3 }">
			<!-- <a class="nav-link" href="operation.html">
				<i class="icon icon-operation"></i>
				<span class="link-text">操作</span>
			</a> -->
			<a class="nav-link" href="${pageContext.request.contextPath}/dataNew.do">
				<i class="icon icon-data"></i>
				<span class="link-text"><msg:message key="menu.data" /></span>
			</a>
			</c:if>
			<%-- <c:if test="${menubean.menu4 }">
			<a class="nav-link" href="history.html">
				<i class="icon icon-history"></i>
				<span class="link-text">历史</span>
			</a>
			</c:if> --%>
			<c:if test="${menubean.menu4 }">
			<a class="nav-link" href="${pageContext.request.contextPath}/faultList.do">
				<i class="icon icon-malfunction"></i>
				<span class="link-text"><msg:message key="menu.error" /></span>
			</a>
			</c:if>
			<c:if test="${menubean.menu5 }">
			<a class="nav-link" href="${pageContext.request.contextPath}/showUserList.do">
				<i class="icon icon-customer-management"></i>
				<span class="link-text"><msg:message key="menu.user" /></span>
			</a>
			</c:if>
			<c:if test="${menubean.menu6 }">
			<a class="nav-link" href="${pageContext.request.contextPath}/statusList.do">
				<i class="icon icon-status"></i>
				<span class="link-text"><msg:message key="menu.status" /></span>
			</a>
			</c:if>
			<c:if test="${menubean.menu7 }">
			<a class="nav-link" href="${pageContext.request.contextPath}/currentList.do">
				<i class="icon icon-malfunction"></i>
				<span class="link-text"><msg:message key="menu.current" /></span>
			</a>
			</c:if>
			<c:if test="${menubean.menu8 }">
			<a class="nav-link" href="${pageContext.request.contextPath}/report.do">
				<i class="icon icon-history"></i>
				<span class="link-text"><msg:message key="menu.report" /></span>
			</a>
			</c:if>
			<a class="nav-link" href="${pageContext.request.contextPath}/logout.do">
				<i class="icon icon-out"></i>
				<span class="link-text"><msg:message key="menu.exit" /></span>
			</a>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
	
	<div class="section">
		<div class="page-mainbox">
			<div>
	   			<input type="button" id="add_config_btn" value="<msg:message key='config.new' />" class="btn btn-primary">
   			</div>
		   	<div class="block20"></div>
		   	<div id="worldcupgird">
		   		<table class="table table-striped table-hover  bg-white">
		   			<thead>	
						<tr>
						  <th width="10%" nowrap="nowrap"><msg:message key='config.name' /></th>
						  <th width="10%" nowrap="nowrap"><msg:message key='config.controlmode' /></th>
						  <th width="6%" nowrap="nowrap" ><msg:message key='config.workmode' /></th>
						  <th width="10%" nowrap="nowrap" ><msg:message key='config.topprotect' />（V）</th>
						  <th width="6%" nowrap="nowrap" ><msg:message key='config.lowprotect' />（V）</th>
						  <th width="6%" nowrap="nowrap" ><msg:message key='config.overcurrent' />（mA）</th>
			<!-- 			  <th width="6%" nowrap="nowrap" >降功率起始电压</th>
						  <th width="6%" nowrap="nowrap" >降功率终止电压</th>
			 -->			  <th width="6%" nowrap="nowrap"><msg:message key='config.operation' /></th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${templateList }" var="bean">
				    		<tr align="center">
				    			<td>${bean.templateName }</td>
				    			<td><c:if test="${bean.controlModelOn eq '1'}"><msg:message key='config.controlmode.turnonlightctrl' /></c:if>
				    				<c:if test="${bean.controlModelOn eq '2'}"><msg:message key='config.controlmode.trunontimectrl' /></c:if>
				    				<c:if test="${bean.controlModelDown eq '1'}"><msg:message key='config.controlmode.turnofflightctrl' /></c:if>
				    				<c:if test="${bean.controlModelDown eq '2'}"><msg:message key='config.controlmode.turnofftimectrl' /></c:if></td>
				    			<td><c:if test="${bean.workModel eq '01' }"><msg:message key='config.workmode.intelligent' /></c:if>
				    				<c:if test="${bean.workModel eq '00' }"><msg:message key='config.workmode.nonintelligent' /></c:if></td>
				    			<td>${bean.topVol }</td>
				    			<td>${bean.lowVol }</td>
				    			<td>${bean.maxWorkCurrent }</td>
				    			<%-- <td>${bean.lowStartVol }</td>
				    			<td>${bean.lowEndVol }</td> --%>
				    			<td>
				    				<%-- <a href="${pageContext.request.contextPath}/templateDetail.do?templateId=${bean.templateId}">详细</a> --%>
				    				<a href="javascript:;" class="btn btn-primary" name="showLiBtn" data-id="${bean.templateId }"><msg:message key='config.operation.detail' /></a>
				    				<a href="javascript:;" class="btn btn-danger" name="deleteLiBtn" data-id="${bean.templateId }"><msg:message key='config.operation.delete' /></a>
			    				</td>
				    		</tr>
						</c:forEach>
					</tbody>
		    	</table>
		   	</div>
		   	
 		</div>
	</div>
   	
		<div id="addTemplateLayer" style="display:none;">
			<div class="form-div padding20" style="margin-right:20px;">
				<form id="addTemplateForm" method="post">
					<div class="view view160">
			            <span class="view-title"><msg:message key='config.name' />：</span>
			            <input type="hidden" id="templateId" name="templateId" />
			            <input id="templateName" name="templateName" class="hw_input9" maxlength="50" type="text" />
			            <i class="ico-must-red">*</i>
			        </div>
			        <div class="block10"></div>
					<div class="view view160">
			            <span class="view-title"><msg:message key='config.controlmode' />：</span>
			            <select id="controlModelOn" name="controlModelOn" onchange="modelChange()" class="hw_input8">
			            	<option value="1"><msg:message key='config.controlmode.turnonlightctrl' /></option>
			            	<option value="2"><msg:message key='config.controlmode.trunontimectrl' /></option>
			            </select>
			            <select id="controlModelDown" name="controlModelDown" onchange="modelChange()" class="hw_input8">
			            	<option value="1"><msg:message key='config.controlmode.turnofflightctrl' /></option>
			            	<option value="2"><msg:message key='config.controlmode.turnofftimectrl' /></option>
			            </select>
			            <i class="ico-must-red">*</i>
			            <span style="margin-left:47px;"><msg:message key='config.workmode' />：</span>
			            <select id="workModel" name="workModel" class="hw_input8">
			            	<option value="01"><msg:message key='config.workmode.intelligent' /></option>
			            	<option value="00"><msg:message key='config.workmode.nonintelligent' /></option>
			            </select>
			            <i class="ico-must-red">*</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			        	<div id="onVolDiv" style="float:left;">
				            <span id="onVolDivDoc"><msg:message key='config.lighton.vol' />：</span>
				            <input id="turnonVol" name="turnonVol" class="hw_input8" maxlength="50" type="text" />
				            <i class="ico-must-red">* (V)</i>
			            </div>
			            <div id="timeonDiv" style="margin-right:23px;float:left;display:none;">
				            <span><msg:message key='config.turnontime' />：</span>
				            <input id="turnonTime" name="turnonTime" class="hw_input8" maxlength="50" type="text" />
				            <i class="ico-must-red">*</i>
				        </div>
				        <div id="timedownDiv" style="margin-left:79px;float:left;display:none;">
				            <span><msg:message key='config.turnofftime' />：</span>
				            <input id="shutdownTime" name="shutdownTime" class="hw_input8" maxlength="50" type="text" />
				            <i class="ico-must-red">*</i>
				        </div>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			        	<span class="view-title"><msg:message key='config.overcurrent' />：</span>
			            <input id="maxWorkCurrent" name="maxWorkCurrent" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must-red">* (mA)</i>
			            <span style="margin-left:110px;"><msg:message key='config.topprotect' />：</span>
			            <input id="topVol" name="topVol" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must">* (V)</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			            <span class="view-title"><msg:message key='config.lowprotect' />：</span>
			            <input id="lowVol" name="lowVol" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must-red">* (V)</i>
			            <span style="margin-left:90px;"><msg:message key='config.exitprotect' />：</span>
			            <input id="exitVol" name="exitVol" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must">* (V)</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			            <span class="view-title"><msg:message key='config.lowstartvol' />：</span>
			            <input id="lowStartVol" name="lowStartVol" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must-red">* (V)</i>
			            <span style="margin-left:107px;"><msg:message key='config.lowendvol' />：</span>
			            <input id="lowEndVol" name="lowEndVol" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must">* (V)</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			            <span class="view-title"><msg:message key='config.first.period' />：</span>
			            <input id="time1" name="time1" class="hw_input8" maxlength="50" type="text"/>
			            <i class="ico-must-red">* (<msg:message key='config.period.unit' />)</i>
			            <span style="margin-left:80px;"><msg:message key='config.first.workingpower' />：</span>
			            <div class="jinduBg"  id="workCurrent1JDBG">
						    <div class="jindu" id="workCurrent1JD"></div>
						</div>
						<input id="workCurrent1" name="workCurrent1" class="hw_input8" maxlength="50" value="50" type="hidden"/>
			            <i class="ico-must">* (<span id="workCurrent1Val">50</span>%)</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			            <span class="view-title"><msg:message key='config.second.period' />：</span>
			            <input id="time2" name="time2" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must-red">* (<msg:message key='config.period.unit' />)</i>
			            <span style="margin-left:80px;"><msg:message key='config.second.workingpower' />：</span>
			            <div class="jinduBg"  id="workCurrent2JDBG">
						    <div class="jindu" id="workCurrent2JD"></div>
						</div>
			            <input id="workCurrent2" name="workCurrent2" class="hw_input8" maxlength="50" value="50" type="hidden" />
			            <i class="ico-must">* (<span id="workCurrent2Val">50</span>%)</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			            <span class="view-title"><msg:message key='config.third.period' />：</span>
			            <input id="time3" name="time3" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must-red">* (<msg:message key='config.period.unit' />)</i>
			            <span style="margin-left:80px;"><msg:message key='config.third.workingpower' />：</span>
			            <div class="jinduBg"  id="workCurrent3JDBG">
						    <div class="jindu" id="workCurrent3JD"></div>
						</div>
			            <input id="workCurrent3" name="workCurrent3" class="hw_input8" maxlength="50" value="50" type="hidden" />
			            <i class="ico-must">* (<span id="workCurrent3Val">50</span>%)</i>
			        </div>
			        <div class="block10"></div>
			        <div class="view view160">
			            <span class="view-title"><msg:message key='config.fourth.period' />：</span>
			            <input id="time4" name="time4" class="hw_input8" maxlength="50" type="text" />
			            <i class="ico-must-red">* (<msg:message key='config.period.unit' />)</i>
			            <span style="margin-left:80px;"><msg:message key='config.fourth.workingpower' />：</span>
			            <div class="jinduBg"  id="workCurrent4JDBG">
						    <div class="jindu" id="workCurrent4JD"></div>
						</div>
			            <input id="workCurrent4" name="workCurrent4" class="hw_input8" maxlength="50" value="50" type="hidden" />
			            <i class="ico-must">* (<span id="workCurrent4Val">50</span>%)</i>
			        </div>
<!-- 					<div class="layui-layer-btn">
						<a class="layui-layer-btn0" onclick="submitAdd();">确定</a>
						<a class="layui-layer-btn0" onclick="defaultConfig();">默认配置</a>
						<a class="layui-layer-btn1">取消</a>
					</div> -->
					<input class="hide" type="reset" name="resetBtn">
				</form>
			</div>
		</div>
		
		<div class="hide" id="memberLayer">
		<div class="form-view padding20">
			<form id="lightsForm">
			<input type="hidden" id="templateIdd" name="templateIdd" />
			<div class="item-view item100">
				<span class="item-title"><msg:message key='config.selectdevice' /></span>
				<div class="view-cont">
					<div class="zTreeDemoBackground">
							<ul id="treeDemo" class="ztree"></ul>
					</div>
	  			</div>
			</div>

			<input class="hide" type="reset" name="resetBtn">
			</form>
		
		</div>
	</div>
		
  </body>
</html>
